package org.jeecg.modules.iot.service;



import org.jeecg.modules.iot.model.Consumption;

import java.sql.Timestamp;
import java.util.List;

public interface IConsumptionService {
    int add(Consumption consumption);
    Consumption queryByDeviceId(String deviceId);
    Consumption queryByFMileage(String deviceId, Float fMileage);
    //根据时间范围查询能耗数据
    List<Consumption> queryConsumptionsByTimeRange(String deviceId, Timestamp startTime, Timestamp endTime);

    Consumption queryLatestByDeviceId(String deviceId);

    Float calculateAverageEConsum(String deviceId, int n);

    Float calculateMileageWeightedAverageEConsum(String deviceId, int n);
}